<template>
  <div class="child-component">
    <p>
      <span>{{ text }}</span>
      <span class="more" @click="jumpTo()">{{ more }}</span>
    </p>
  </div>
</template>

<script setup lang="ts">
import { defineProps } from "vue";

const props = defineProps({
  text: {
    type: String,
    required: true,
    default: "",
  },
  more: {
    type: String,
    default: "",
  },
  url: {
    type: String,
    default: "",
  },
});

function jumpTo() {
  if (props.url) {
    window.open(props.url);
  }
}
</script>

<style scoped lang="less">
@import "@/assets/common/font.css";

.child-component {
  position: relative;
  height: 22px;
  background-image: url(@/assets/components/2.png);
  background-repeat: no-repeat;
  background-size: contain;
  margin-bottom: 5px;

  p {
    position: absolute;
    top: 2px;
    left: 25px;
    font-size: 12px;
    color: #fff;
    font-weight: bold;
    letter-spacing: 1.3px;
    display: flex;
    align-items: center;
  }

  .more {
    top: 7px;
    left: 132px;
    font-size: 8px;
    color: #ffffff;
    margin-left: 10px;
    font-weight: 300;
    letter-spacing: 1px;
    font-family: YSBT;
  }
}
</style>